// JavaScript Document.....
<!--

// printer icon mouseover
if (document.images) {
	img_on = new Image(); img_on.src = "/gfx/print_mouseover.gif";
	img_off = new Image(); img_off.src = "/gfx/print.jpg";
}
function printOver() {
	if (document.images) document.print_icon.src = img_on.src;
}
function printOut() {
	if (document.images) document.print_icon.src = img_off.src;
}

/*function resize() {
	if (parseInt(navigator.appVersion)>3) {
		if (navigator.appName=="Netscape") {
			winW = window.innerWidth;
			winH = window.innerHeight;
		}
		if (navigator.appName.indexOf("Microsoft")!=-1) {
			winW = document.body.offsetWidth;
			winH = document.body.offsetHeight;
		}
	}
	if (winW%2 != 0) {
		document.body.style.backgroundPosition = 'center-1px';
	} else {
		document.body.style.backgroundPosition = '50%';
	}
}
*/
function popupWindow(page, height, width, scrollbars){
	var w = height;
	var h = width;
	if (window.screen.availWidth) {
		var sw = window.screen.availWidth;
		var sh = window.screen.availHeight;
	} else if (window.screen.width) {
		var sw = window.screen.width;
		var sh = window.screen.height;
	} else {
		var sw = 800;
		var sh = 600;
	}
	var l = Math.floor((sw - w) / 2);
	var t = Math.floor((sh - h) / 2);
	window.open(page, "windowOpen", "width=" + w + ", height=" + h + ", left = " + l + ", top = " + t + ",directories=no,toolbar=no,location=no,status=no,menubar=no,scrollbars=" + scrollbars + ",resizable=no").focus();
}
function mailTo(username,hostname,ext){
	location.href = "mailto:"+username+"@"+hostname+"."+ext+"";
}
var xmlhttp;
var xmlhttp2;
function loadXMLDoc(url)
{
if (window.XMLHttpRequest)
  {
  xmlhttp=new XMLHttpRequest()
  xmlhttp.onreadystatechange=xmlhttpChange
  xmlhttp.open("GET",url,true)
  xmlhttp.send(null)
  }
else if (window.ActiveXObject)
  {
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")
    if (xmlhttp)
    {
    xmlhttp.onreadystatechange=xmlhttpChange
    xmlhttp.open("GET",url,true)
    xmlhttp.send()
    }
  }
}
function xmlhttpChange()
{
if (xmlhttp.readyState==4)
  {
  if (xmlhttp.status==200)
    {
eval(xmlhttp.responseText);
    }
  else
    {
    alert("Problem retrieving XML data")
		alert(xmlhttp.responseText);
    }
  }
}
function expandcollapse(id) {
	var e = document.getElementById(id);
	if(e.style.display == 'none')
		e.style.display = 'block';
	else
		e.style.display = 'none';
}
function isEmail(inputStr) {
	var supported = 0;
	if (window.RegExp){
		var tempStr = "a";
		var tempReg = new RegExp(tempStr)
		if (tempReg.test(tempStr)) supported = 1;
	}
	if (!supported)
		return (inputStr.indexOf(".") > 2) && (inputStr.indexOf("@") > 0);
		var r1 = new RegExp("(@.*@)|(\\.\\.)|(@\\.)|(^\\.)");
		var r2 = new RegExp("^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,4}|[0-9]{1,4})(\\]?)$"); 
	return (!r1.test(inputStr) && r2.test(inputStr));
}
function setClassName(objId, className) {
    document.getElementById(objId).className = className;
}
function getUserGuide(){
	window.top.close();
	window.top.opener.focus();
	window.top.opener.location.href = window.top.opener.location.pathname+"?Preview={C270C715-A8AC-49BC-B19F-3754C37D6BD2}";
}
function callFlashSoundPicture(param){
		 var so = new SWFObject("/web2/Picture/picture_sound.swf", "slideShow", "789", "425", "8", "#333333");
		 so.addVariable("hyperlink", param);
		 so.addVariable("resourcefolder", "/web2/picture/");
		 so.addParam("menu", "false")
		 so.write("flashcontent");
}
function callFlashReload(source,param){
	var so = new SWFObject(source, "slideShow", "789", "425", "8", "#333333");
	so.addVariable("hyperlink", param);
	so.addParam("menu", "false")
	so.write("flashcontent");
}
var swfSlideShow;
function initializeExternalInterface() {
	var ie = navigator.appName.indexOf("Microsoft") != -1;
	swfSlideShow = (ie) ? window['slideShow'] : document['slideShow'];
}
function callFlashSlideToPage(number) {
	initializeExternalInterface();
	swfSlideShow.slideToPage(number);
}



function frontpage_personalize(value, gotoid) {
	// set time, it's in milliseconds
	var path = '';
	var today = new Date();
	today.setTime(today.getTime());
	/* if the expires variable is set, make the correct expires time, the current script below will set 
	it for x number of days, to make it for hours, delete * 24, for minutes, delete * 60 * 24 */
	var expires = 365 * 1000 * 60 * 60 * 24;
	var expires_date = new Date(today.getTime() + (expires));
	document.cookie = "frontpage_personalize=" +escape(value) +
	((expires) ? ";expires=" + expires_date.toGMTString() : "") + 
	((path) ? ";path=/" + path : "");
	if (gotoid > 0) {
			window.location = "?id="+gotoid
	} else if (value == "automotive") {
			window.location = "?id=130";
	} else if (value == "hospitality") {
			window.location = "?id=133";
	} else if (value == "private") {
			window.location = "?id=185";
	} else if (value == "architect") {
			window.location = "?id=133";
	} else if (value == "retailopp") {
			window.location = "?id=176";
	} else if (value == "investors") {
			window.location = "?id=64";
	} else if (value == "press") {
			window.location = "?id=174";
	} else if (value == "careers") {
			window.location = "?id=88";
	} else if (value == "other") {
			window.location = "?id=185";
	} else {
			window.location = "?id=1";
	}
}

function eStore(url, productName) {
	if(typeof Instadia_sendEvent == 'function') {Instadia_sendEvent('0112L','eStore - '+productName);}
	newWindow = window.open(url,'','height=700,width=790,scrollbars=1')
}

function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function eraseCookie(name) {
	createCookie(name,"",-1);
}